package com.huan.rss.bean;

import lombok.Data;

import java.io.Serializable;
import java.io.StringWriter;
import java.util.Date;

@Data
public class CommonInformationItem implements Serializable {
    private String title;//标题
    private String link;//链接
    private StringBuffer description;//描述
    private String pubDate;//发布时间
    private Date Date;
    private String id;
    private String source;

    public void addDescription(String description){
        this.description.append(description);
    }

    public String getFileName() {
        StringWriter writer = new StringWriter();
        writer.append(source);
        writer.append("-");
        writer.append(String.valueOf(description.hashCode()));
        writer.append("xml");
        return writer.toString();
    }
}
